package models

import (
	"time"
	"github.com/astaxie/beego/orm"
)

type Node struct {
	Id         int
	Title      string        `ht:"list;search;name(名称)"  valid:"Required;"`
	CreatTime  time.Time        `ht:"hide;defaultvalue(time.Now())"`
	UpdateTime time.Time         `ht:"list;name(编辑时间);defaultvalue(time.Now())"`
	FatherNode int                `ht:"name(父节点Id)"  `
	Status     int                `ht:"hide"`
	Type       int                `ht:"name(类型);list;subclass([{\"Num\":1,\"Name\":\"个人\"},{\"Num\":2,\"Name\":\"企业\"}])"`
	Content    string        `orm:"type(text)" ht:"type(mutitext);name(内容)"`
	CreatorId  int        `ht:"name(创建者Id)"  valid:"Required;"`
	EditorId   int        `ht:"name(编辑者Id)"  valid:"Required;"`
}

func init() {
	orm.RegisterModel(new(Node))
}
func (*Node)TableName() string {
	return "node"
}

func (*Node) FN_Id() string {
	return "Id"
}
func (*Node) FN_Title() string {
	return "Title"
}
func (*Node) FN_CreatorId() string {
	return "CreatorId"
}
func (*Node) FN_EditorId() string {
	return "EditorId"
}
func (*Node) FN_CreatTime() string {
	return "CreatTime"
}
func (*Node) FN_UpdateTime() string {
	return "UpdateTime"
}
func (*Node) FN_FatherNode() string {
	return "FatherNode"
}
func (*Node) FN_Status() string {
	return "Status"
}
func (*Node) FN_Type() string {
	return "Type"
}
func (*Node) FN_Content() string {
	return "Content"
}